<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<script src="./js/socket.io.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		
		<button>发送消息到群聊</button>
		<script type="text/javascript">
			let con = io.connect("http://localhost:3000");
			con.on('connect',function(data){
				console.log("连接事件")
				//添加进入群聊房间
				con.emit('addRoom',{
					room:'qunliao'
				})
				
				
				
			})
			
			//qunliao
			con.on('qunliao',function(data){
				console.log(data)
			})
			document.querySelector('button').onclick = function(){
				con.emit('sendMsgRoom',{
					room:"qunliao",
					content:"这是发送给群聊房间的内容"
				})
			}
		</script>
	</body>
</html>
